home *** CD-ROM | disk | FTP | other *** search
- Copyright 1986, Arnold Bernard Krueger. All rights reserved
- except by written permission of the author. You may negotiate
- for permission by calling 313-881-4829. Specific permission to
- to place documention, executable program, and source code
- on display, together, in a public place granted to EXEC-PC,
- Shorewood, WI.
-
-
- Program to check file specified for current date.
-
-
- Usage is: LASTRUN filename.ext
-
- filename.ext must exist and be 4 bytes (2 words) long.
-
- * It is checked for the current date in binary.
- * It is called the argument file and controls an action.
- * It should not be used for any other purpose.
- * It will be updated daily.
- * You can have as many as you want to control different
- actions.
- * A sample file named LASTRUN.DFL is provided.
-
- To set it up (details below), make both words zeros and run LASTRUN.
-
- if file has current date, LASTRUN returns errorlevel 0
- if file date is in the past, LASTRUN returns errorlevel 1, and updates it
- if file is in the future, LASTRUN returns errorlevel 2
-
-
- Errorlevel 0 means "skip the action"
- Errorlevel 1 means "take the action"
- Errorlevel 2 means "the PC's real time clock is giving bad data"
-
- Examples of use:
-
- 1. Most careful hard disk users run CHKDSK in their AUTOEXEC.BAT
- This tips you off about some potential problems before things get
- out of hand.
- But you don't need to run CHKDSK every boot; once a day is enough
- Solution: use LASTRUN as follows:
-
- ECHO OFF
- ASTCLOCK /R (or substitute your clock software)
- LASTRUN LASTRUN.DAT
- IF ERRORLEVEL 1 GOTO RUNCHK
- GOTO NOCHK
- RUNCHK:
- CHKDSK
- NOCHK:
-
- 2. Clock batteries run down, or boot diskettes sometimes get run on
- computers with the wrong clock hardware. Note, even if you have no clock
- hardware, why be prompted for time and date on warm boots?
-
-
- Solution: use LASTRUN as follows:
-
- ECHO OFF
- ASTCLOCK /R (or substitute your clock software)
- LASTRUN LASTRUN.DAT
- IF ERRORLEVEL 2 GOTO BADTIME
- GOTO NOCHK
- BADTIME:
- DATE
- TIME
- NOCHK:
-
-
- 3. Modify example (1) to type out check list of items to be done first
- thing every day, when computer is turned on.
-
- 4. Trigger automatic incremental backups every day.
-
-
- A sample argument file named LASTRUN.DFL is provided in this .ARC package.
-
- Create argument file as follows:
-
- DEBUG filename.ext
- run DEBUG.COM . File shouldn't be found
- E 100 ;enter data into file
- 00 00 00 00 ;make first four bytes zero
- RCX ;set length
- 4 ;to be four
- W ;write file out
- Q ;and quit
- LASTRUN filename.ext ;make it current
-
-
-
-
-
-
-
-
-
-
-
-
-
- ╕ pppp pp pp pppp GGWRW á @αÇ └` á@αÇ └`